/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.handeasy.session;

import com.handeasy.entity.CommentEntity;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Amaury
 */
@Stateless
public class CommentState {
    
    @PersistenceContext(unitName="HandEasy-ejbPU")
    private EntityManager em;
    
    
    public CommentState(){}
    
     public List<CommentEntity> getComments(){
        
        System.out.println("GETCOMMENTS");
        Query q = em.createQuery("select c from CommentEntity c");
        
        q.setMaxResults(25);
        
        return q.getResultList();
    }
    
    
}
